#!/usr/bin/env python
#coding=utf-8
import socket
import struct
import time
import threading

class con_connect(threading.Thread):
	str = 'x' * 1400
	host = '192.168.129.129'
	port = 8881
	def __init__(self):
		threading.Thread.__init__(self)
		
	def run(self):
		s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
		s.connect((self.host, self.port))
		for i in range(10000):
			time.sleep(1)
			msg = struct.pack('ii', 200, 1400)
			s.send(msg)
			s.send(self.str)
		s.close()
thread_list = []
for i in range(500):
	con = con_connect()
	con.start()
	thread_list.append(con)
for thr in thread_list:
	thr.join()
